<img src="./img/person.jpg" class="photos" id="photoPath">
<ul class="con">
	<li>
		<p>
			<label class="title">性别:</label>
			<span class="cont" id="sex"></span>
		</p>
		<p>
			<label class="title">职务:</label>
			<span class="cont" id="job"></span>
		</p>
	</li>
	<li>
		<p>
			<label class="title min_title">单位名称:</label>
			<span class="cont" id="unitName">甘肃紫光智能与控制技术有限公司</span>
		</p>
	</li>
	<li>
		<p>
			<label class="title">交通运输部执法证号:</label>
			<span class="cont" id="transportNo">131503775</span>
		</p>
	</li>
	<li>
		<p>
			<label class="title">甘肃省政府执法证号:</label>
			<span class="cont" id="governmentNo">S131503775</span>
		</p>
	</li>
	<li>
		<p>
			<label class="title">群众满意度评分:</label>
			<span class="cont" id="satisfactionScore">98分</span>
		</p>
	</li>
	<li>
		<p>
			<label class="title min_title">单位地址:</label>
			<span class="cont" id="unitAddress">甘肃省兰州市城关区雁南路236号</span>
		</p>
	</li>
	<li>
		<p>
			<label class="title min_title">执法区域:</label>
			<span class="cont" id="lawArea">甘肃省兰州市城关区雁南路K4545+000+K343+373</span>
		</p>
	</li>
	<li>
		<p>
			<label class="title min_title">单位电话:</label>
			<span class="cont" id="unitPhone">0931-2323334</span>
		</p>
	</li>
	<li>
		<p>
			<label class="title min_title">监督电话:</label>
			<span class="cont" id="supervisePhone">0931-3434444</span>
		</p>
	</li>
</ul>
<footer class="footer">
	<p class="oper" id="oper">
		<input type="hidden" id="userId">
		<button class="btn" id="addComment">满意度评价</button>
		<button class="btn btn_info">信用红黑名单</button>
	</p>
	<!-- <img src="./img/rq_code.png" alt="" class="qr_code"> -->
</footer>

<!-- 加载效果 -->
<div class="mask">
	<div class="loading">
		<span></span>
		<span></span>
		<span></span>
		<span></span>
		<span></span>
	</div>
</div>
<!-- 请求失败 -->
<section class="alert">
	<section class="error msg_cont">
		<i class="iconfont icon-shibai error"></i>
		<h1>请求失败</h1>
	</section>
</section>
<script>
	$(function () {
		var id = getQueryString('id');
		// 获取个人信息
		if (id) {
			$.ajax({
				url: "http://www.microsoft.com",
				dataType: "json",
				async: true,
				data: { "id": "value" },
				type: "GET",
				timeout: 2000,
				beforeSend: function () {
					$(".mask").show();
				},
				success: function (res) {
					$(".mask").hide();
					result(res.data)
					
				},
				error: function () {
					$(".mask").hide();
					msgHShowOrHide('.error')
				}
			});
		}

		$("#oper").on('click', '.btn', function () {
			var id = $(this).attr('id');
			if (id === 'addComment') { // 评价
				$('#main').load('./commont.html');
				var userId = $("#userId").val();
				if (userId) localStorage.setItem('userId', userId);
			} else { // 信用红黑名单
				var userId = $("#userId").val();
				if (userId) localStorage.setItem('userId', userId);
				$('#main').load('./list.html');
			}
		})
	})

	function result(obj) {
		Object.keys(obj).map(function (v) {
			if (v === 'photoPath') {
				$("#photoPath").prop('src', obj[photoPath])
			} else {
				$("#" + v).text(obj[v] ? obj[v] : '-')
			}
		})
	}
</script>